package org.xiaov.framework.constant;

/**
 * <p>
 * http协议的一些状态码
 * </p>
 *
 * @author xiaovcloud
 * @date 2021/2/1 14:29
 */
public enum HttpCode {
    /**
     * Continue
     */
    HTTP_CONTINUE(100, "Continue"),
    /**
     * OK
     */
    HTTP_OK(200, "OK"),
    /**
     * Created
     */
    HTTP_CREATED(201, "Created"),
    /**
     * Accepted
     */
    HTTP_ACCEPTED(202, "Accepted"),
    /**
     * Non-Authoritative Information
     */
    HTTP_NOT_AUTHORITATIVE(203, "Non-Authoritative Information"),
    /**
     * No Content
     */
    HTTP_NO_CONTENT(204, "No Content"),
    /**
     * Reset Content
     */
    HTTP_RESET(205, "Reset Content"),
    /**
     * Partial Content
     */
    HTTP_PARTIAL(206, "Partial Content"),
    /**
     * Multiple Choices
     */
    HTTP_MULT_CHOICE(300, "Multiple Choices"),
    /**
     * Moved Permanently
     */
    HTTP_MOVED_PERM(301, "Moved Permanently"),
    /**
     * Temporary Redirect
     */
    HTTP_MOVED_TEMP(302, "Temporary Redirect"),
    /**
     * See Other
     */
    HTTP_SEE_OTHER(303, "See Other"),
    /**
     * Not Modified
     */
    HTTP_NOT_MODIFIED(304, "Not Modified"),
    /**
     * Use Proxy
     */
    HTTP_USE_PROXY(305, "Use Proxy"),
    /**
     * Bad Request
     */
    HTTP_BAD_REQUEST(400, "Bad Request"),
    /**
     * Unauthorized
     */
    HTTP_UNAUTHORIZED(401, "Unauthorized"),
    /**
     * Payment Required
     */
    HTTP_PAYMENT_REQUIRED(402, "Payment Required"),
    /**
     * Forbidden
     */
    HTTP_FORBIDDEN(403, "Forbidden"),
    /**
     * Not Found
     */
    HTTP_NOT_FOUND(404, "Not Found"),
    /**
     * Method Not Allowed
     */
    HTTP_BAD_METHOD(405, "Method Not Allowed"),
    /**
     * Not Acceptable
     */
    HTTP_NOT_ACCEPTABLE(406, "Not Acceptable"),
    /**
     * Proxy Authentication Required
     */
    HTTP_PROXY_AUTH(407, "Proxy Authentication Required"),
    /**
     * Request Time-Out
     */
    HTTP_CLIENT_TIMEOUT(408, "Request Time-Out"),
    /**
     * Conflict
     */
    HTTP_CONFLICT(409, "Conflict"),
    /**
     * Gone
     */
    HTTP_GONE(410, "Gone"),
    /**
     * Length Required
     */
    HTTP_LENGTH_REQUIRED(411, "Length Required"),
    /**
     * Precondition Failed
     */
    HTTP_PRECON_FAILED(412, "Precondition Failed"),
    /**
     * Request Entity Too Large
     */
    HTTP_ENTITY_TOO_LARGE(413, "Request Entity Too Large"),
    /**
     * Request-URI Too Large
     */
    HTTP_REQ_TOO_LONG(414, "Request-URI Too Large"),
    /**
     * Unsupported Media Type
     */
    HTTP_UNSUPPORTED_TYPE(415, "Unsupported Media Type"),
    /**
     * Internal Server Error
     */
    HTTP_INTERNAL_ERROR(500, "Internal Server Error"),
    /**
     * Not Implemented
     */
    HTTP_NOT_IMPLEMENTED(501, "Not Implemented"),
    /**
     * Bad Gateway
     */
    HTTP_BAD_GATEWAY(502, "Bad Gateway"),
    /**
     * Service Unavailable
     */
    HTTP_UNAVAILABLE(503, "Service Unavailable"),
    /**
     * Gateway Timeout
     */
    HTTP_GATEWAY_TIMEOUT(504, "Gateway Timeout"),
    /**
     * HTTP Version Not Supported
     */
    HTTP_VERSION(505, "HTTP Version Not Supported");

    private final String msg;
    private final Integer code;

    HttpCode(Integer code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    public Integer getValue() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
